<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta name="format-detection" content="telephone=no, address=no, email=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<link rel="stylesheet" href="css/mui.min.css" type="text/css" charset="utf-8" />
		<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
		<link rel="stylesheet" href="css/product.css" type="text/css" charset="utf-8" />
		<style>
			.mui-table-view .mui-table-view-cell {
				margin-bottom: 0.14rem;
				border-top: 1px solid #ddd;
				border-bottom: 1px solid #ddd;
				background: #fff;
			}
			
			.mui-table-view .mui-table-view-cell a {
				color: #666;
			}
			
			
			
			.tableView {}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" style="padding: 0px;height: 3.02rem;">
			<div class="header" style="height: 3.02rem;">
				<div class="mui-header text-center" style="background:none;padding-top:0.27rem">
					<div class="title">个人中心</div>
					<div class="text-center personInfo" style="margin-top:0.86rem;">
						<p class="title">唐大牛</p>
						<p>18595689568</p>
					</div>
				</div>

			</div>
		</header>
		<div class="mui-content" style="margin-top:2.64rem;padding-left:0rem;padding-right:0rem;">

			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell"  id="personInfo">
					<a href="javascript:;" class="mui-navigate-right">个人资料</a>
				</li>
				<li class="mui-table-view-cell" id="msgCenter" >
					<a href="javascript:;"class="mui-navigate-right">消息中心</a>
				</li>
				<li class="mui-table-view-cell" id="msgSetting">
					<a href="javascript:;" class="mui-navigate-right">设置</a>
				</li>
				<li class="mui-table-view-cell" id="personSafe">
					<a href="javascript:;" class="mui-navigate-right">安全</a>
				</li>
			</ul>

			<div class="mui-button-row" style="position:absolute;bottom:1.35rem;left:0.24rem;right:0.24rem;">
				<button type="button" class="mui-btn mui-btn-primary mui-btn-full" id="register" style="height:44px;border-radius:0px;background:#f1c40f;color:#fff;border-color:#f1c40f">确认</button>
			</div>
		</div>
		<footer class="mui-bar mui-bar-footer">
			<nav class="mui-bar mui-bar-tab" style="font-weight: bold;">
				<a class="mui-tab-item mui-active" id="main-main" data-title="主页">
					<span class="pic-icon pic-icon-home"></span>
					<span class="mui-tab-label">主页</span>
				</a>
				<a class="mui-tab-item" id="main-inout" data-title="出入库">
					<span class="pic-icon pic-icon-inout"></span>
					<span class="mui-tab-label">出入库</span>
				</a>
				<a class="mui-tab-item" id="main-jxs" data-title="经销商">
					<span class="pic-icon pic-icon-jxs"></span>
					<span class="mui-tab-label">经销商</span>
				</a>
				<a class="mui-tab-item" id="main-center" data-title="个人中心">
					<span class="pic-icon pic-icon-person"></span>
					<span class="mui-tab-label">个人中心</span>
				</a>
			</nav>
		</footer>

	</body>
	<script src="js/resize.js"></script>
	<script src="js/mui.min.js"></script>
	<script src="js/redirect.js"></script>
	<script type="text/javascript">
	mui.plusReady(function() {
		mui.init({
			preloadPages: [{
				url: 'personInfo.html',
				id: 'personInfo',
				styles: {}, //窗口参数
				extras: {}, //自定义扩展参数
				subpages: [{}, {}] //预加载页面的子页面
			}, {
				url: 'msgCenter.html',
				id: 'msgCenter',
				styles: {}, //窗口参数
				extras: {}, //自定义扩展参数
				subpages: [{}, {}] //预加载页面的子页面
			}, {
				url: 'msgSetting.html',
				id: 'msgSetting',
				styles: {}, //窗口参数
				extras: {}, //自定义扩展参数
				subpages: [{}, {}] //预加载页面的子页面
			}, {
				url: 'personSafe.html',
				id: 'personSafe',
				styles: {}, //窗口参数
				extras: {}, //自定义扩展参数
				subpages: [{}, {}] //预加载页面的子页面
			}],
			preloadLimit: 5 //预加载窗口数量限制(一旦超出,先进先出)默认不限制
		});
		var mainPage;
		var toPage = function(pageId) {
			//使用定时器的原因：
			//可能执行太快，main页面loaded事件尚未触发就执行自定义事件，此时必然会失败
			var id = setInterval(function() {				
					clearInterval(id);
					mui.fire(mainPage, 'show', null);
					mainPage.show("pop-in");
			}, 20);
		};
		
		var list=document.querySelectorAll('.mui-table-view-cell');
		for(var i=0;i<list.length;i++){
			var temp=list[i];
			temp.addEventListener('tap',function(){
				var id=this.getAttribute('id');
				mainPage = plus.webview.getWebviewById(id);
				var main_loaded_flag = true;
				//不知道为什么没有进去
				/*mainPage.addEventListener("loaded", function() {
					main_loaded_flag = true;
				});*/
//				console.log(main_loaded_flag);
				if(main_loaded_flag) {
					toPage(id);
				}
			})
		}
	})
		
	</script>

</html>